import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpDistributeSet {
  id!: number;
  rank?: boolean;
  inBuy?: boolean;
  isGrade?: boolean;
  condition?: boolean;
  isSh?: boolean;
  img?: unknown;
  inAgreementTitle?: string;
  inAgreement?: unknown;
  courseDis?: boolean;
  courseCommissionType?: boolean;
  courseCommission1?: string;
  courseCommission2?: string;
  courseCommission3?: string;
  vipDis?: boolean = false;
  vipCommissionType?: boolean = true;
  vipCommission1?: string;
  vipCommission2?: string;
  vipCommission3?: string;
  goodDis: boolean = false;
  goodCommissionType: boolean = true;
  goodCommission1!: string;
  goodCommission2!: string;
  goodCommission3!: string;
  enrollDis: boolean = false;
  enrollCommissionType: boolean = true;
  enrollCommission1!: string;
  enrollCommission2!: string;
  enrollCommission3!: string;
  uniacid?: number;
  addTime?: string;
  updateTime?: string;
  cwfxsTitle?: string;
  ptTitle?: string;
  sqcwfxsTitle?: string;
  fxddTitle?: string;
  txmxTitle?: string;
  fxyjTitle?: string;
  wdtdTitle?: string;
  wdfxmTitle?: string;
  lxkfTitle?: string;
  zyjTitle?: string;
  ktxyjTitle?: string;
  ytxyjTitle?: string;
  wjsyjTitle?: string;
  yjTitle?: string;
  ejTitle?: string;
  sjTitle?: string;
  payType?: unknown;
  minPrice?: string;
  maxPrice?: string;
  commission?: string;
  notice?: unknown;
}

export const ImsYzdKpDistributeSetSchema = new EntitySchema({
  class: ImsYzdKpDistributeSet,
  properties: {
    id: { primary: true, type: 'number' },
    rank: { type: 'boolean', nullable: true },
    inBuy: { type: 'boolean', nullable: true },
    isGrade: { type: 'boolean', nullable: true },
    condition: { type: 'boolean', nullable: true },
    isSh: { type: 'boolean', nullable: true },
    img: { type: 'unknown', columnType: 'longtext', nullable: true },
    inAgreementTitle: { type: 'string', length: 255, nullable: true },
    inAgreement: { type: 'unknown', columnType: 'longtext', nullable: true },
    courseDis: { type: 'boolean', nullable: true },
    courseCommissionType: { type: 'boolean', nullable: true },
    courseCommission1: {
      type: 'string',
      fieldName: 'course_commission_1',
      columnType: 'numeric(10,2)',
      nullable: true,
    },
    courseCommission2: {
      type: 'string',
      fieldName: 'course_commission_2',
      columnType: 'numeric(10,2)',
      nullable: true,
    },
    courseCommission3: {
      type: 'string',
      fieldName: 'course_commission_3',
      columnType: 'numeric(10,2)',
      nullable: true,
    },
    vipDis: { type: 'boolean', nullable: true, default: false },
    vipCommissionType: { type: 'boolean', nullable: true, default: true },
    vipCommission1: {
      type: 'string',
      fieldName: 'vip_commission_1',
      columnType: 'numeric(10,2)',
      nullable: true,
      defaultRaw: `20.00`,
    },
    vipCommission2: {
      type: 'string',
      fieldName: 'vip_commission_2',
      columnType: 'numeric(10,2)',
      nullable: true,
      defaultRaw: `10.00`,
    },
    vipCommission3: {
      type: 'string',
      fieldName: 'vip_commission_3',
      columnType: 'numeric(10,2)',
      nullable: true,
      defaultRaw: `2.00`,
    },
    goodDis: { type: 'boolean', default: false },
    goodCommissionType: { type: 'boolean', default: true },
    goodCommission1: {
      type: 'string',
      fieldName: 'good_commission_1',
      columnType: 'numeric(10,2)',
      defaultRaw: `20.00`,
    },
    goodCommission2: {
      type: 'string',
      fieldName: 'good_commission_2',
      columnType: 'numeric(10,2)',
      defaultRaw: `10.00`,
    },
    goodCommission3: {
      type: 'string',
      fieldName: 'good_commission_3',
      columnType: 'numeric(10,2)',
      defaultRaw: `5.00`,
    },
    enrollDis: { type: 'boolean', default: false },
    enrollCommissionType: { type: 'boolean', default: true },
    enrollCommission1: {
      type: 'string',
      fieldName: 'enroll_commission_1',
      columnType: 'numeric(10,2)',
      defaultRaw: `20.00`,
    },
    enrollCommission2: {
      type: 'string',
      fieldName: 'enroll_commission_2',
      columnType: 'numeric(10,2)',
      defaultRaw: `10.00`,
    },
    enrollCommission3: {
      type: 'string',
      fieldName: 'enroll_commission_3',
      columnType: 'numeric(10,2)',
      defaultRaw: `5.00`,
    },
    uniacid: { type: 'number', nullable: true },
    addTime: { type: 'string', length: 255, nullable: true },
    updateTime: { type: 'string', length: 255, nullable: true },
    cwfxsTitle: { type: 'string', length: 255, nullable: true },
    ptTitle: { type: 'string', length: 255, nullable: true },
    sqcwfxsTitle: { type: 'string', length: 255, nullable: true },
    fxddTitle: { type: 'string', length: 255, nullable: true },
    txmxTitle: { type: 'string', length: 255, nullable: true },
    fxyjTitle: { type: 'string', length: 255, nullable: true },
    wdtdTitle: { type: 'string', length: 255, nullable: true },
    wdfxmTitle: { type: 'string', length: 255, nullable: true },
    lxkfTitle: { type: 'string', length: 255, nullable: true },
    zyjTitle: { type: 'string', length: 255, nullable: true },
    ktxyjTitle: { type: 'string', length: 255, nullable: true },
    ytxyjTitle: { type: 'string', length: 255, nullable: true },
    wjsyjTitle: { type: 'string', length: 255, nullable: true },
    yjTitle: { type: 'string', length: 255, nullable: true },
    ejTitle: { type: 'string', length: 255, nullable: true },
    sjTitle: { type: 'string', length: 255, nullable: true },
    payType: { type: 'unknown', columnType: 'longtext', nullable: true },
    minPrice: { type: 'string', columnType: 'numeric(10,2)', nullable: true },
    maxPrice: { type: 'string', columnType: 'numeric(10,2)', nullable: true },
    commission: { type: 'string', columnType: 'numeric(10,2)', nullable: true },
    notice: { type: 'unknown', columnType: 'longtext', nullable: true },
  },
});
